package cn.wzvtc.soft14;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by linji on 2016/3/18.
 */
@Service
public class KebiaoService {
    /**根据周次和班级返回班级课表信息
     * @param week -周次
     * @param clazz- 班级
     * @return 课表信息
     */
    public List getKebiao(int week,  int clazz) {
        return (List)this.keRepository.findByWeekAndClazz(week,clazz);
    }


    @Autowired
    private KeRepository keRepository;//注意变量命名一定是类名首字母小写其他不变。
    public void saveKe(Ke k) {
        this.keRepository.save(k);

    }

    public List getAllLession() {
        //自带findAll，findOne等基础增删改查方法，请去浏览下！
        return (List)this.keRepository.findAll();
    }
}
